<template>
  <div>
    <h1>我是登录页面</h1>
    <router-link to="/abc">登录</router-link>
    <router-link to="/one">跳转one</router-link>

    <router-view ></router-view>

    <!-- <button @click="fun">One</button>
    <button @click="fun2">Two</button>
    <div class="rou">
        <keep-alive :include='["One","Two"]'><router-view></router-view></keep-alive>
    </div>
    <button @click="fun3">前进</button>
    <button @click="fun4">后退</button> -->
    <!-- query 字符串写法 -->
    <!-- <router-link to="/home?userName='张三'&age=18">登录</router-link> -->
    <!-- <router-link :to="`/home?userName=${mun.userNam}&age=${mun.age}`">登录</router-link> -->
    <!-- query 对象写法 -->
    <!-- <router-link :to="{
        path:'/home',
        query:{
            userName:mun.userNam,
            age:mun.age
        }
    }
    ">登录</router-link> -->
    <!-- 简化跳转 -->
    <!-- <router-link :to="{name:'Home'}">登录</router-link> -->
    <!-- 简化跳转传参 -->
    <!-- <router-link :to="{
        name:'Home',
        query:{
            userName:mun.userNam,
            age:mun.age
        }
    }
    ">登录</router-link> -->
    <!-- params 字符串写法 -->
     <!-- <router-link :to="`/home/${mun.userNam}/${mun.age}`">登录</router-link> -->
     <!-- params 对象写法 -->
     <!-- <router-link :to="{
        name:'Home',
        params:{
            userName:mun.userNam,
            age:mun.age
        }
    }
    ">登录</router-link> -->
    <!-- 账号：<input type="text" v-model="userList.mobile">
    密码：<input type="password" v-model="userList.password">
    <button @click="loginBtn()">登录</button> -->
  </div>
</template>

<script>
import service from "@/api/request"
export default {
    name:"LoginUser",
    data() {
        return {
            userList:{
                mobile:13800000002,
                password:"hm#qd@23!"
            },
            mun:{
                userNam:'张三1',
                age:10
            }
        }
    },
    methods:{
        // fun(){
        //     this.$router.push('/login/One')
        // },
        // fun2(){
        //     this.$router.push('/login/Two')
        // },
        // fun3(){
        //     this.$router.forward()
        // },
        // fun4(){
        //     this.$router.back()
        // }
        // async loginBtn(){
        //     const {data} = await service.post("/api3/api/sys/login",this.userList);
        //     console.log(data);
        //     if(data.code==10000){
        //         console.log("登录成功");
        //         this.$router.push("/home");
        //         sessionStorage.setItem("token",data.data)
        //     }else{
        //         console.log("登录失败");
        //     }
        // }
    }
}
</script>

<style scoped>
/* .active {
    color:pink !important;
} */
.rou{
    width: 200px;
    height: 200px;
    border: 1px solid #000;
}
</style>